<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>用户注册 - Spring Boot 管理系统</title>
    <style>
        /* 全局样式（保留原有美化配置，仅移除ID相关样式） */
        :root {
            --primary-color: #6366f1;
            --secondary-color: #8b5cf6;
            --accent-color: #f472b6;
            --text-color: #334155;
            --bg-color: #f8fafc;
            --card-bg: #ffffff;
            --border-radius: 12px;
            --box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.1), 0 8px 10px -6px rgba(99, 102, 241, 0.1);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            line-height: 1.6;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
            background-image:
                    radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.05) 0%, transparent 20%),
                    radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.05) 0%, transparent 20%);
        }

        .register-wrapper { max-width: 450px; width: 100%; position: relative; }

        .register-card {
            background: var(--card-bg);
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 40px;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        .register-card::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); }
        .register-card:hover { transform: translateY(-5px); box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.1); }

        .register-title {
            font-size: 28px;
            font-weight: 700;
            color: var(--text-color);
            margin-bottom: 20px;
            text-align: center;
            position: relative;
            padding-bottom: 15px;
        }
        .register-title::after { content: ""; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 60px; height: 3px; background: linear-gradient(90deg, var(--primary-color), var(--secondary-color)); border-radius: 3px; }

        .form-group { margin-bottom: 25px; position: relative; }

        .form-group label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            color: #64748b;
            margin-bottom: 8px;
            transition: color 0.3s ease;
        }
        .form-group input:focus + label,
        .form-group input:not(:placeholder-shown) + label {
            color: var(--primary-color);
            transform: translateY(-20px);
            font-size: 12px;
        }

        .form-group input {
            width: 100%;
            padding: 16px 18px;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            font-size: 16px;
            color: var(--text-color);
            background: transparent;
            transition: border-color 0.3s ease, box-shadow 0.3s ease;
        }
        .form-group input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }

        .btn {
            width: 100%;
            padding: 14px;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            color: white;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .btn:hover { opacity: 0.95; transform: translateY(-2px); box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.2); }

        .message {
            padding: 12px;
            border-radius: 8px;
            margin-bottom: 20px;
            text-align: center;
            font-size: 14px;
            font-weight: 500;
        }
        .message.success { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
        .message.error { background-color: rgba(239, 68, 68, 0.1); color: #ef4444; }

        .login-link { text-align: center; font-size: 14px; color: #64748b; margin-top: 25px; }
        .login-link a { color: var(--primary-color); text-decoration: none; font-weight: 500; transition: color 0.3s ease; }
        .login-link a:hover { color: var(--secondary-color); text-decoration: underline; }

        @media (max-width: 480px) { .register-card { padding: 30px 25px; } .register-title { font-size: 24px; } }

        .floating-icon {
            position: absolute;
            top: 15px;
            right: 15px;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
            animation: float 3s ease-in-out infinite;
        }
        @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
    </style>
</head>
<body>
<div class="register-wrapper">
    <div class="register-card">
        <div class="floating-icon">✦</div>

        <h2 class="register-title">创建新账户</h2>

        <div class="message success" th:if="${param.success}">
            注册成功！请前往登录页面。
        </div>
        <div class="message error" th:if="${param.error}">
            注册失败，请检查信息并重试。
        </div>

        <form action="/doRegister" method="post">
            <!-- 移除ID输入框 -->
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" id="username" name="username" required placeholder="请输入用户名">
            </div>

            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" id="password" name="password" required placeholder="请输入密码">
            </div>

            <button type="submit" class="btn">
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 16 16">
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm0-14a6 6 0 1 1 0 12 6 6 0 0 1 0-12z"></path>
                    <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 4v3m0 4v3"></path>
                </svg>
                立即注册
            </button>
        </form>

        <div class="login-link">
            已有账号？<a href="/login">前往登录</a>
        </div>
    </div>
</div>
</body>
</html>